package org.wanho.rent.service.impl;

import java.util.List;

import org.wanho.rent.dao.ProductTypeDao;
import org.wanho.rent.entity.ProductType;
import org.wanho.rent.factory.ObjectFactory;
import org.wanho.rent.service.ProductTypeService;
import org.wanho.rent.util.PageInfo;

public class ProductTypeServiceImpl implements ProductTypeService{

	private ProductTypeDao productTypeDao = (ProductTypeDao) ObjectFactory.getObject("productTypeDao");
	
	@Override
	public PageInfo<ProductType> findByPage(int pageNo, int pageSize) {
		List<ProductType> list = productTypeDao.selectByPage(pageNo, pageSize);
		
		int total = productTypeDao.selectCount();
		
		PageInfo<ProductType> pageInfo = new PageInfo<ProductType>(total, pageNo, pageSize, list);
		return pageInfo;
	}

	@Override
	public List<ProductType> findAll() {
		return productTypeDao.selectAll();
	}

}
